package org.jeecg.modules.lab.device.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.lab.device.entity.LabDevice;
import org.jeecg.modules.lab.device.vo.LabDevRunPage;
import org.jeecg.modules.lab.device.vo.LabDevicePage;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Description: 实验室设备信息
 * @Author: jeecg-boot
 * @Date: 2023-07-05
 * @Version: V1.0
 */
@Repository
public interface LabDeviceMapper extends BaseMapper<LabDevice> {


    /**
     * 查询设备和器具
     *
     * @return
     */
    public List<LabDevicePage> selectDeviceAndUtensil(@Param("devName") String devName,
                                                      @Param("devNum") String devNum,
                                                      @Param("status") String status,
                                                      @Param("devType") String devType,
                                                      @Param("startTime") String startTime,
                                                      @Param("endTime") String endTime);

    public void updateStatus(@Param("useStatus") String useStatus, @Param("devIds") List<String> devIds);


    /**
     * 统计设备的运行时长
     * @param devId
     * @param devName
     * @param devNum
     * @param devModel
     * @param status
     * @param startTime
     * @param endTime
     * @return
     */
    public List<LabDevRunPage> getSumDevRunTime(@Param("devId") String devId,
                                                @Param("devName") String devName,
                                                @Param("devNum") String devNum,
                                                @Param("devModel") String devModel,
                                                @Param("status") String status,
                                                @Param("startTime") String startTime,
                                                @Param("endTime") String endTime);

}
